/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cassys.datatransferobjects;

import java.io.Serializable;
import java.util.*;

/**
 *
 * @author Priyanka
 */
public class AssessmentDTO implements Serializable {

    private String assessmentId;
    private String title;
    private String description;
    private int maximumMark;
    //change this later
    private String owner;
    private String type;
    private int noOfTeams;
    private String moduleCode;
    private int toRange;
    private int fromRange;
    private Set<EvaluationDTO> evaluations;
    private List<AssessmentItemsDTO> assessmentItems;

    public Set<EvaluationDTO> getEvaluations() {
        return evaluations;
    }

    public void setEvaluations(Set<EvaluationDTO> evaluations) {
        this.evaluations = evaluations;
    }

    public AssessmentDTO() {
        evaluations = new TreeSet<EvaluationDTO>();
        assessmentItems = new ArrayList<AssessmentItemsDTO>();
    }

    public void setAssessmentItems(List<AssessmentItemsDTO> assessmentItems) {
        this.assessmentItems = assessmentItems;
    }

    public List<AssessmentItemsDTO> getAssessmentItems() {
        return assessmentItems;
    }

    public void setFromRange(int fromRange) {
        this.fromRange = fromRange;
    }

    public void setToRange(int toRange) {
        this.toRange = toRange;
    }

    public int getFromRange() {
        return fromRange;
    }

    public int getToRange() {
        return toRange;
    }

    public AssessmentDTO(String assessmentId, String title, String description, int maximumMark,
            int range, String owner, String type, String moduleCode) {
        this.assessmentId = assessmentId;
        this.title = title;
        this.description = description;
        this.maximumMark = maximumMark;
        this.toRange = range;
        this.owner = owner;
        this.type = type;
        this.moduleCode = moduleCode;
    }

    public String getAssessmentId() {
        return assessmentId;
    }

    public void setAssessmentId(String assessmentId) {
        this.assessmentId = assessmentId;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public void setMaximumMark(int maximumMark) {
        this.maximumMark = maximumMark;
    }

    public void setModuleCode(String moduleCode) {
        this.moduleCode = moduleCode;
    }

    public void setNoOfTeams(int noOfTeams) {
        this.noOfTeams = noOfTeams;
    }

    public void setOwner(String owner) {
        this.owner = owner;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getDescription() {
        return description;
    }

    public int getMaximumMark() {
        return maximumMark;
    }

    public String getModuleCode() {
        return moduleCode;
    }

    public int getNoOfTeams() {
        return noOfTeams;
    }

    public String getOwner() {
        return owner;
    }

    public String getTitle() {
        return title;
    }

    public String getType() {
        return type;
    }

    public void setAssessmentItem(AssessmentItemsDTO dto) {
        if (assessmentItems != null) {
            assessmentItems.add(dto);
        }
    }

    public AssessmentItemsDTO getAssessmentItem(int index) {
        if (assessmentItems != null) {
            return assessmentItems.get(index);
        } else {
            return null;
        }
    }

    public EvaluationItemDTO getEvaluationItem(int index) {
        if (evaluations != null) {
            for (EvaluationDTO evaluation : evaluations) {
                return evaluation.getEvalutionItems().get(index);
            }
            return null;
        } else {
            return null;
        }
    }
}
